<template>
  <view class="go-top-com-page" v-if="props.show">
    <view class="go-top-wrap" @click="goTop">
      <view class="iconfont icon-up"></view>
    </view>
  </view>
</template>
<script setup lang="ts">
/**
 * 模块引入
 */
import { reactive, getCurrentInstance, onMounted } from "vue";
const { proxy } = getCurrentInstance();
/**
 * 接口
 */
/**
 * 父组件数据
 */
const props = defineProps({
  show: {
    type: Boolean,
    default: false,
  },
});
/**
 * 数据
 */
const data = reactive({});
/**
 * 初始方法
 */
onMounted(() => {});
/**
 * 功能方法
 */
const goTop = () => {
  emit("goTop");
};
/**
 * 父组件方法
 * const emit = defineEmits(['function']);
 * emit('function', data);
 */
const emit = defineEmits(["goTop"]);
/**
 * 父组件传递生命周期方法
 * onShareAppMessage  分享好友
 * onShareTimeline 分享朋友圈
 * onReachBottom 页面内触底
 */
</script>
<style lang="scss" scoped>
@import url("@/static/css/theme.scss");
.go-top-com-page {
  .go-top-wrap {
    position: fixed;
    width: 60rpx;
    height: 60rpx;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    right: 40rpx;
    bottom: 40rpx;
    background: #fff;
    box-shadow: 0 2px 15px 0 rgb(0 0 0 / 10%);
  }
}
</style>
